﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using WAD.WEB.AppCode;
using WAD.BLL;

namespace WAD.WEB
{
    public partial class test : WxJsWebBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string msg = "";
            string channelid = "5543121005272584452";
            string ApiKey = Request["key"];
            string SecretKey = Request["skey"];
            string store = Request["store"];

            if (!string.IsNullOrEmpty(Request["channelid"]))
                channelid = Request["channelid"];

            if (string.IsNullOrEmpty(store))
                store = "0";

            int article_id = Parse.Int("article_id", 137);
            if (Request["clientid"] == "1")
            {
                List<object> ids = new List<object>();
                string[] arr = channelid.Split(',');
                for (int i = 0; i < arr.Length; i++)
                    ids.Add(arr[i]);
                msg = PushBLL.AndroidBetch("推送demo", "推送测试内容", ids, Push_Code.REDIRECT, string.Format("http://{0}/client/makesh_1.html?article_id={1}", Request.Url.Authority, article_id));
            }
            else
                msg = PushBLL.IOS("推送demo", "推送测试内容", channelid, store, Push_Code.REDIRECT, string.Format("http://{0}/client/makesh_1.html?article_id={1}", Request.Url.Authority, article_id));

            //List<Dictionary<string, object>> dic = DAOFCSetting.GetListPush("", "", "", "100094");
            //int count = PushBLL.Shared_Betch(123, dic);
            //Response.Write(count);
            Response.Write(msg);
        }
    }
}